<template>
  <div class="list">
    <p>list</p>
    <p>{{ $store.state.count }}</p>
    <p>{{ $count }}</p>
    <p>{{ $square }}</p>
  </div>
</template>

<script setup>
import { computed } from 'vue';
import { useStore } from 'vuex';
//借助useStore

const store = useStore()

const $count = computed(() => {
  return store.state.count
})

const $square = computed(() => 
  store.getters.countSquare
)

</script>

<style  scoped>
.list {
  min-height: 300px;
  background-color: greenyellow;
}
</style>